﻿using Dapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SYJ.Model
{
    public class QueryModel
    {
        public QueryModel()
        {
            this.PageIndex = 1;
            this.PageSize = 15;
            this.Offset = 0;
            this.OrderName = "id";
            this.SortOrder = "desc";
            this.SqlWhere = "";
            this.Param = new DynamicParameters();
        }
        /// <summary>
        /// 当前索引
        /// </summary>
        public int PageIndex { get; set; }
        /// <summary>
        /// 每页多少条
        /// </summary>
        public int PageSize { get; set; }
        /// <summary>
        /// 偏移量（PageIndex*PageSize）
        /// </summary>
        public int Offset { get; set; }
        
        /// <summary>
        /// 排序 asc /desc
        /// </summary>
        public string SortOrder { get; set; }
        /// <summary>
        /// 排序字段
        /// </summary>
        public string OrderName { get; set; }

        /// <summary>
        /// 查询条件
        /// </summary>
        public string SqlWhere { get; set; }
        /// <summary>
        /// 查询参数
        /// </summary>
        public DynamicParameters Param { get; set; }
    }
}
